﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CarbonExchange.Bll
{
    public class Country : ItemBase
    {
        internal Country() { Locale = "EN-GB"; }
        
        public Country(int siteId) 
        { 
            this.SiteId = siteId; 
        }

        public Country(int siteId, string locale)
        {
            this.SiteId = siteId;
            this.Locale = locale;
        }

        public int Id { get; internal set; }
        public int SiteId { get; internal set; }
        public string Name
        {
            get
            {
                var tmp = RegionInfo;
                if (tmp != null)
                {
                    return tmp.EnglishName;
                }
                else
                {
                    return null;
                }
            }
        }

        public string CurrencySymbol
        {
            get
            {
                var tmp = RegionInfo;
                if (tmp != null)
                {
                    return tmp.CurrencySymbol;
                }
                else
                {
                    return null;
                }
            }
        }

        public System.Globalization.RegionInfo RegionInfo
        {
            get
            {
                return new System.Globalization.RegionInfo(this.Locale);
            }
        }

        public System.Globalization.CultureInfo CultureInfo
        {
            get
            {
                return new System.Globalization.CultureInfo(this.Locale);
            }
        }

        public DateTime Created { get; internal set; }
        public string Locale { get; set; }
        public decimal Conversion { get; set; }
    }
}
